
export const productColumns = [
  {
    title: '#',
    scopedSlots: { customRender: 'serial' },
    fixed: 'left'
  },
  {
    title: '名称',
    dataIndex: 'goodsName',
    fixed: 'left'
  },
  {
    title: '品牌',
    dataIndex: 'brand'
  },
  {
    title: '参数',
    dataIndex: 'options'
  },
  {
    title: '单位',
    dataIndex: 'unit'
  },
  {
    title: '数量',
    dataIndex: 'count'
  },
  {
    title: '单价',
    dataIndex: 'price'
  },
  {
    title: '供应商',
    dataIndex: 'supplierName'
  },
  {
    title: '备注',
    dataIndex: 'note',
    ellipsis: true
  }
  // {
  //   title: '操作',
  //   dataIndex: 'action',
  //   width: 120,
  //   scopedSlots: { customRender: 'action' },
  //   fixed: 'right'
  // }
]
// buyListColumns1
export const buyListColumns1 = [
  {
    title: '#',
    scopedSlots: { customRender: 'serial' },
    width: 10,
    fixed: 'left'
  },
  {
    title: '名称',
    dataIndex: 'goodsName',
    width: 120,
    fixed: 'left'
  },
  {
    title: '数量',
    dataIndex: 'count',
    width: 80,
    fixed: 'left'
  },
  {
    title: '剩余可交付数量',
    dataIndex: 'leftCount',
    width: 100,
    fixed: 'left'
  },
  {
    title: '品牌',
    dataIndex: 'brand',
    width: 80
  },
  {
    title: '单位',
    dataIndex: 'unit',
    width: 80
  },
  {
    title: '单价',
    dataIndex: 'price',
    width: 100
  },
  {
    title: '供应商',
    dataIndex: 'supplierName',
    width: 200
  },
  {
    title: '备注',
    dataIndex: 'note',
    // ellipsis: true
    width: 350
  },
  {
    title: '操作',
    dataIndex: 'action',
    width: 120,
    scopedSlots: { customRender: 'action' },
    fixed: 'right'
  }
]
export const buyListColumns = [
  {
    title: '#',
    scopedSlots: { customRender: 'serial' },
    width: 10,
    fixed: 'left'
  },
  {
    title: '名称',
    dataIndex: 'goodsName',
    width: 120,
    fixed: 'left'
  },
  {
    title: '数量',
    dataIndex: 'count',
    width: 80,
    fixed: 'left'
  },
  {
    title: '品牌',
    dataIndex: 'brand',
    width: 80
  },
  {
    title: '参数',
    dataIndex: 'options',
    width: 100
  },
  {
    title: '单位',
    dataIndex: 'unit',
    width: 80
  },
  {
    title: '单价',
    dataIndex: 'price',
    width: 100
  },
  {
    title: '供应商',
    dataIndex: 'supplierName',
    width: 200
  },
  {
    title: '备注',
    dataIndex: 'note',
    // ellipsis: true
    width: 350
  },
  {
    title: '操作',
    dataIndex: 'action',
    width: 120,
    scopedSlots: { customRender: 'action' },
    fixed: 'right'
  }
]

export const productColumns2 = [
  {
    title: '#',
    scopedSlots: { customRender: 'serial' }
  },
  {
    title: '名称',
    dataIndex: 'productName'
  },
  {
    title: '品牌',
    dataIndex: 'brand'
  },
  {
    title: '参数',
    dataIndex: 'options'
  },
  {
    title: '单位',
    dataIndex: 'unit'
  },
  {
    title: '数量',
    dataIndex: 'count'
  },
  {
    title: '单价',
    dataIndex: 'price'
  },
  {
    title: '备注',
    dataIndex: 'note'
  },
  {
    title: '操作',
    dataIndex: 'action',
    width: '150px',
    scopedSlots: { customRender: 'action' }
  }
]

export const computeProgress = (levle1Tasks) => {

}

export const computeCurrent = (levle2Tasks) => {
  let current = 0
  for (const ind in levle2Tasks) {
    if (levle2Tasks[ind].status === 3) {
      current++
    } else {
      break
    }
  }
  return current
}
